/**
 * @(#) EquipmentProperty.java
 */

package cn.edu.sjtu.se.dslab.component.data;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "equipment_property")
public class EquipmentProperty implements Serializable {

	private static final long serialVersionUID = -7451719354760966355L;

	private long id;
	
	private DomainEntity type;
	
	private String name;
	
	private EquipmentCategory category;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	@ManyToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "category_id", nullable = false)
	public EquipmentCategory getCategory() {
		return category;
	}

	public void setCategory(EquipmentCategory category) {
		this.category = category;
	}

	@ManyToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "type_id")
	public DomainEntity getType() {
		return type;
	}

	public void setType(DomainEntity type) {
		this.type = type;
	}

	@Column(name = "name", nullable = false)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
